package cn.iocoder.yudao.module.resource.api;

import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.resource.api.model.AudioToneDTO;
import cn.iocoder.yudao.module.resource.dal.dataobject.audiotone.AudioToneDO;
import cn.iocoder.yudao.module.resource.service.audiotone.AudioToneService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

@Service
public class AudioToneApiImpl implements IAudioToneApi {
    @Resource
    private AudioToneService audioToneService;

    @Override
    public AudioToneDTO getById(Integer id) {
        final AudioToneDO audioTone = audioToneService.getAudioTone(id);
        if (audioTone != null) {
            return BeanUtils.toBean(audioTone, AudioToneDTO.class);
        }
        return null;
    }

    @Override
    public void setCloneVoiceId(Integer id, String cloneVoiceId) {
        audioToneService.setCloneVoiceId(id, cloneVoiceId);
    }
}
